import Vue from 'vue'
import App from './App.vue'
import ElementUI from "element-ui";

import 'animate.css';

import router from "./router";
import store from "./store"
import moment from "moment";

import VueCookies from "vue-cookies";

import JsonExcel from 'vue-json-excel'


Vue.component('downloadExcel', JsonExcel)


import 'bootstrap/dist/css/bootstrap.min.css'  //bootstrap css
import "bootstrap"


Vue.use(VueCookies);

import * as echarts from 'echarts';

Vue.prototype.$echarts = echarts
Vue.prototype.$moment = moment

/* ElementUI 样式文件 */
import 'element-ui/lib/theme-chalk/index.css';
/* 断点隐藏样式文件 */
import 'element-ui/lib/theme-chalk/display.css';

/* 注册ElementUI */
Vue.use(ElementUI);

// 自定义指令 全局
// 参考：https://cn.vuejs.org/v2/guide/custom-directive.html
Vue.directive('permission', function (el, {value}) {
    if (!store.state.userStore.roles.some(role => value.includes(role))) {
        el.style.display = 'none'
    }
})


Vue.config.productionTip = false

new Vue({
    render: h => h(App),
    router,
    store
}).$mount('#app')
